package chapter05.E1;

public class E1 {
    public static void main(String[] args) {
        String name = "蘑菇头";
        String str1 = new String();
        String str2 = new String("abcd");
        // 调用字符串数组String方法
        char[] charArray = new char[]{'D', 'E', 'F'};
        String str3 = new String(charArray);
        // 调用字符串类构造方法 将byte数组转换为字符串
        byte[] byteAeeay = {97, 98, 99};
        String str4 = new String(byteAeeay);
        System.out.println("str1 = "+str1);
        System.out.println("str2 = "+str2);
        System.out.println("str3 = "+str3);
        System.out.println("str4 = "+str4);
    }
}
